Modified Harris Hawks Optimization Algorithm with Exploration Factor and Random Walk Strategy

One of the most popular population-based metaheuristic algorithms is Harris hawks optimization (HHO), which imitates the hunting mechanisms of Harris hawks in nature. Although HHO can obtain optimal solutions for specific problems, it stagnates in local optima solutions. In this paper, an improved Harris hawks optimization named ERHHO is proposed for solving global optimization problems. Firstly, we introduce tent chaotic map in the initialization stage to improve the diversity of the initialization population. Secondly, an exploration factor is proposed to optimize parameters for improving the ability of exploration. Finally, a random walk strategy is proposed to enhance the exploitation capability of HHO further and help search agent jump out the local optimal. Results from systematic experiments conducted on 23 benchmark functions and the CEC2017 test functions demonstrated that the proposed method can provide a more reliable solution than other well-known algorithms.


Introduction
In recent years, because of the low computing cost, simplicity, flexibility, and gradient-free mechanisms [1] and metaheuristic algorithms (MAs) [2][3][4][5] have attracted a rising amount of interest. In most cases, MAs are motivated by the ideas of evolution [6][7][8], human [9][10][11][12], animal behavior [13][14][15][16], or physics [17][18][19][20][21]. Kennedy et al. [22] inspired by the regularity of flock foraging behavior and proposed particle swarm optimization (PSO) with the characteristics of fast convergence speed and fewer parameters. Mirjalili et al. [23] proposed an algorithm called grey wolf optimization (GWO) based on the grey wolves' hierarchy system and hunting strategies. e whale optimization algorithm (WOA) [24] simulates a whale's random search and predation, bubble attack, and contraction surround behavior. e salp swarm algorithm (SSA) [25] is inspired by the leader guiding followers' behavior of salp swarm chains to food. e sine cosine algorithm (SCA) [26] is proposed to optimize the aircraft wing design problem by searching the image inward or outward with the sine and cosine function, which can deep mine the best position and finally achieves the global optimum. Slime mould algorithm (SMA) [27] is motivated mainly by changes in slime mould morphology during foraging.
In the field of MAs, the no free lunch (NFL) theorem [28] illustrates that there is no one-size-fits-all solution to all optimization challenges. erefore, many researchers show great interest not only in proposing a new algorithm but also in optimizing classical algorithms.
Zheng et al. [29] propose an algorithm called improved remora optimization algorithm (IROA) that improves the remora optimization algorithm (ROA) by introducing an autonomous foraging mechanism. is mechanism is based on the way the remora finds food on its own. Abualigah et al. [30] combine the arithmetic optimization algorithm (AOA) with SCA's operators for enhancing the local search ability of AOA and verify the effectiveness by some experiments. Jia et al. [31] come up with an algorithm called CMSRSSMA with an improvement of SMA by embedding the composite mutation strategy (CMS) and restart strategy (RS). e CMS aims to enhance the population diversity, and the RS is utilized to avoid the local optima. Liu et al. [32] present a modified remora optimization algorithm (MROA) with Brownian motion and lens opposition-based learning, and it can be suitable for the multilevel thresholding image segmentation application. Meanwhile, the new algorithm introduces the nonlinear escaping energy parameters and random-opposition-based learning strategies to make itself more competitive. Almotairi and Abualigah [33] proposed a method called HRSA, which hybrid the original reptile search algorithm (RSA) and ROA by a novel transition method, and applied it to solving data clustering problems. Zamfirache et al. [34] apply a new algorithm hybrid policy iteration (PI) and GWO algorithm to neural networks and get good results in NN training and solving complex optimization problems. Pozna et al. [35] proposed a new algorithm called PF-PSO that hybrid particle filter (PF) and PSO algorithm and applied the new hybrid method to optimize the position control of the integral-type serve systems.
In 2019, Heidari et al. [36] proposed the HHO algorithm, which is inspired by the Harris hawks' predation behavior in nature, including three stages of exploration, the transformation from exploration to exploitation, and exploitation. HHO has the characteristics of simple principles, fewer parameters, and strong local optimization ability. HHO has been used in the aspect of image segmentation [37], neural network [38], electric machine control [39], and other fields. However, HHO has the weakness of limited optimization accuracy, low convergence speed, and easily jumping into local optimum like other MAs. erefore, many scholars have improved the HHO algorithm from different perspectives. Ma et al. [40] used the Chan algorithm to calculate the initial solution and replace an individual position to reduce unnecessary exploration and improve the algorithm's convergence speed. Houssein et al. [41] introduced cross and mutation cooperative gene operators and proposed the HHOCM optimization algorithm based on oppositionbased learning, which enhanced the ability of exploration and applied it to generate the initial population effectively. Tang et al. [42] introduced the tent chaotic map, an elite hierarchy system, nonlinear escape energy strategy, and Gaussian random walk strategy to improve the convergence speed and accuracy of the algorithm. Jia et al. [43] introduced a mutation strategy and dynamic control parameter for calculating escape energy in the exploration stage and achieved good results by regulating different parameters. e above improvement strategy has improved the performance of the HHO algorithm, but it still has significant room for improvement for the shortcomings of the HHO algorithm. We proposed the ERHHO algorithm to surmount some weaknesses of the HHO algorithm. Based on different experiments, the proposed algorithm was evaluated with some classic algorithms such as SMA and SSA and some HHO optimizer algorithms such as DHHO and CEHHO. And the results show that the proposed algorithm can perform better than the competitive algorithms and enhance the ability to jump out of the local optimum with minor changes. In particular, this paper made the following main contributions: (i) Introduced tent chaotic map to improve the quality of initialized population location (ii) Proposed the strategy called exploration factor in improving the ability of exploration (iii) Proposed the random walk strategy to promote the convergence speed and accuracy (iv) e simulation experiments are tested on 23 standard test functions (v) e real-world problems tests are based on CEC2017 test functions and five classical engineering problems e remainder of this document is structured as follows. A quick summary of HHO is given in Section 2. Section 3 describes the tent chaotic map, exploration factor, random walk strategy, and ERHHO algorithm. e results and discussion of the proposed algorithm are given in Section 4, which mainly applies to benchmark functions, and real problems include CEC2017 and engineering design problems. Section 5 contains the conclusions and prospects.

Harris Hawks Algorithm
e HHO algorithm is motivated by different attack strategies of hawks exploring and attacking their prey. HHO is a population-based optimization technology that consists of three stages: exploration, the transformation of exploration, and exploitation. e different phases of HHO are shown in Figure 1.

Exploration Stage.
At this stage, hawks perch in random places based on other members or rabbit locations, which are modeled as follows: where X(t + 1) represents the new position of hawks in the next iteration, X rabbit (t) is the position of prey, and X(t) is the position of hawks. e modulus means the absolute value of the elements. r 1 , r 2 , r 3 , r 4 , and q are random numbers in the interval (0, 1). UB and LB are the upper and lower bounds of variables. X rand (t) is the position of a random hawk population. X m (t) is the average location of the current population of hawks.

Transformation of Exploration and Exploitation.
e escape energy of the prey is a major factor in the transition stage, which is evaluated with the following equations: where t is the current iteration; E 0 is the initial energy of a prey, varying randomly between −1 and 1; and T is the maximum number of iterations.

Exploitation Stage.
At this point, the hawks assault the prey using four chasing strategies and the prey's escape behavior. Escaping energy (E) and the potential of escape (r) are required for a successful capture. When r ≥ 0.5 and |E| ≥ 0.5, a soft besiege was conducted by hawks in the following equations, which means the prey has enough energy but gets a failed try for escaping: where ΔX(t) is the contrast between the position of hawks at iteration t and the current position of prey and X rabbit (t) represents the leap strength that changes randomly at each iteration. r 5 is a random number between 0 and 1.
Hawks applies a hard besiege to prey with low escaping energy and fails to escape, which is indicated by r ≥ 0.5 and |E| < 0.5, modeled as follows: When r < 0.5 and |E| ≥ 0.5, hawks hunt through a smarter soft encirclement called soft besiege with progressive rapid dives, modeled as follows: where D is the problem's dimension, S denotes a random vector of size 1 × D, and LF means the Levy flight function as defined in equations.
where u, v are random normal distribution vector with the size of 1 × d, β is a constant and bound to a value of 1.5, and Γ is a standard Gamma function. Updating the hawk's positions can be modeled by When the prey's energy is depleted, a hard besiege is established (r < 0.5 and |E| < 0.5). e calculation of Y and Z is modeled as equations (13) and (14). e updating method is as follows:

Tent Chaotic Map.
For the past few years, many scholars have proved that chaotic maps [44,45] are capable of improving the search process of a population-based metaheuristic algorithm. In general, chaotic maps are usually introduced into one or several processes such as initial population, exploration, or exploitation stage. e images of the 10 most commonly used chaotic maps are shown in Figure 2.
One of the main purposes of this paper is to enhance the diversity of the initialization population. e initialization of location has a certain influence on the diversity of the population and the stability of the algorithm. HHO algorithm can only guarantee the randomness of the population position at the initialization stage, but randomness does not Computational Intelligence and Neuroscience mean uniformity. e chaotic sequence has certain ergodicity and high randomness. Chaotic mapping can generate random numbers with a uniform distribution between 0 and 1. We tested the listed 10 chaotic maps and verified that tent chaotic map is appropriate to our modified algorithm. e characteristics and randomness of this map can effectively improve the performance by transforming the initial position of hawks. e mathematical description is shown in the following equation: We enhance the diversity of the initialization population by modifying the initial positions through equation (16), where X i+1 represents the new position of hawks after chaotic mapping, X i is the current position of hawks, and a is set to 0.7.

Exploration Factor.
In the exploration stage, the HHO algorithm updating positions is mainly calculated by equations (1) and (2), where r 1 and r 3 are random values in the range of (0, 1). Although the settings could lead to the randomness of each step in the global search, the variability is lacking.
In this phase, the original HHO algorithm simulates the situation that the hawks can track and detect the prey with their powerful eyes, but occasionally, the prey cannot be seen easily, and the hawks detect a prey maybe after several hours. According to these, we think we should adjust the parameters to be more flexible.
We can consider the parameters of r 1 and r 3 as the step length; when the values are bigger, the hawks move faster and vice versa. ere are two possibilities for a hawk finding a prey, one is an immediate detection, and another is a longtime search. For the first situation, we should consider the randomness of the step length. And, for the second situation, the whole variant trend of the step length should decrease. Because the possibility for a hawk finding a prey increases as time goes by, the hawks should explore a wider range with a bigger step at first, and a meticulous search should be applied in the late iterations. us, we update r 1 and r 3 by exploration factor modeled as follows: en equation (1) is updated as follows: where b is set to 2 that can achieve a pleasing effect through experimental tests. (b * rand − b/2) is introduced to gain the randomness of step length by generating random numbers in the interval of (−b/2, b/2). e cos function is introduced   to form a nonlinear convergence from 1 to 0 with iterations (see Figure 3). In a word, the exploration factor expands the range of step length from (0, 1) to (−b/2, b/2) at first and helps the exploration process gradually change from an extensive range to a small range as the number of iterations increases (see Figure 4). Finally, the exploration factor preserved the randomness of step length.

Random Walk Strategy.
In the exploitation stage of the HHO algorithm, Harris hawks update its position through four pursuit strategies. Although it increases the possibility of exploration, entering the next iteration without interference can easily lead to the algorithm falling into the local optimum. To ameliorate this problem, some common strategies are applied to the methods, such as the Gaussian random walk strategy [42], Levy flight function, and Brownian motion [16,46]. ese strategies possess the traits of stabilizing in a range of values with high probability and drastic changing values with low probability. And all these strategies improve the methods by generating a deviation.
In this paper, we think that in the early iterations, the deviation should be bigger so that we can get more chances to jump out of local optima. In the late iterations, a smaller deviation can help find the optimal result better. So we designed the step of random walk gradually taper with iterations. According to these, the random walk strategy was proposed, which is activated by identical fitness values in iterations. In other words, when the value of fitness is equal to its last iteration, we activate the random walk strategy.
is strategy can deviate the position of a hawk according to a varying parameter. e value of the parameter depends on (c × rand() − c/2) × cos(π/2 × (t/T) and decreases with iterations. e strategy is modeled as follows: When c � 6, we can obtain a better performance through the experimental test. X m (i) is the new position after applying the random walk strategy. We retain the better result to enter the next iteration by greedy strategy modeled as follows: 3.4. e Details of ERHHO. HHO possesses strong local exploitation ability but insufficient global exploration. e switch from exploration to exploitation is based on the prey's escaping energy. e population diversity is insufficient in the early iterations, reflecting the exploration period and the slow convergence speed. e energy of prey drops as the number of iterations grows, and the algorithm enters the period of local exploitation. Four different hunting techniques are applied based on the prey's energy and the likelihood of escaping. erefore, the tent chaotic map was introduced to enhance the population diversity; then, we optimized critical parameters in the exploration phase with the exploration factor. As a component of the exploitation phase, a random walk strategy was introduced to enhance the ability to jump out of local optima. e convergence speed and accuracy are improved through all of these approaches, and the program's overall optimization performance is effectively enhanced.
is new Harris hawks optimization algorithm is called ERHHO. Figure 5 depicts the summary flowchart, and Algorithm 1 represents the pseudocode for ERHHO. We employ a random walk strategy to prevent the algorithm from entering local optima, and the computational complexity is O(2 × N × D × T). Hence, the proposed ERHHO algorithm has a total computational complexity of

Experimental Results and Discussion
In this part, we validate the performance of ERHHO on 23 benchmark functions [47] by comparing it with some stateof-art metaheuristics algorithms: SMA, WOA, SSA, SCA, and HHO, and HHO-based optimization algorithm: DHHO/M and HHOCM. Meanwhile, we use the Wilcoxon signed-rank test to acknowledge the differences between ERHHO and the comparative algorithms. Furthermore, we test ERHHO with HHO-related algorithms: HHO, DHHO/ M, HHOCM, and CEHHO on CEC2017 test functions to testify the real-world applications. And also the five engineering design issues are applied with the same algorithms as in benchmark functions' tests. Return the best solution X best t<T Calculate the escaping energy (E) by equations (3) and (4)  (10) if |E| ≥ 1 then %phase of exploration (11) Update the position of X t i by equations (2), (17), and (18) %exploration factor (12) if |E| < 1 then %phase of exploitation (13) if r ≥ 0.5 and |E| ≥ 0.5 then %soft besiege (14) Update the position of X t i by equations (5) and (6)  (15) else if r ≥ 0.5 and |E| < 0.5 then %hard besiege (16) Update the position of X t i by equation (7)  (17) else if r < 0.5 and |E| ≥ 0.5 then %soft besiege with progressive rapid dives (18) Update the position of X t i by equations (8)-(12) (19) else if r < 0.5 and |E| < 0.5 then %hard besiege with progressive rapid dives (20) Update the position of X t i by equations (13) ) then %random walk strategy (22) Update the position of X t walk i by equation (19) then %greedy strategy (24) Update the position of X t i by equation (20)  To make the experimental findings more representative, the ERHHO is compared with algorithms of SMA [27], WOA [24], SSA [25], SCA [26], and HHO [36], DHHO/M [43], and HHOCM [41]. Table 2 shows the parameter settings for each algorithm. All the parameters are set according to the original articles except b and c (the analysis of b and c are listed in Section 4.2). e maximum iteration (T) was set to 500; the population size (N) was set to 30; and the dimension size (D) was set to 30 in all tests. We calculate average results and standard deviations with 30 independent runs and bold the best values.

Sensitivity Analysis of b and c on ERHHO.
e parameter settings of comparative algorithms are in accordance with the original articles, as well as the values of β and a of ERHHO are according to the original HHO algorithm. e new parameters are b and c, which can significantly impact the performance of ERHHO. us, setting the appropriate parameters for better results is necessary. e aims of b and c are to find a suitable search range. According to equation (17), the original range is between 0 and 1; for expanding the scope, b is considered as 2, 4, and 6; and c is considered as 2, 4, and 6. To find the fit b-c value pair, we tested 9 situations by using 23 benchmark functions. We calculate the mean results of each function with 30 independent runs, and the results are listed in Table 3. e lowest values are highlighted in bold. We count the number of bold fonts in each function, and the ERHHO algorithm can get the best performance with b � 2 and c � 6. e parameter values will be used for further experimental tests.  Table 4. Especially, for F1-F4, ERHHO can obtain the theoretical optimum. And the result of ERHHO ranks only second to SSA for F6. e aim of unimodal benchmark functions is to measure the exploitation ability. From the experimental tests of F1-F7, we can prove that the proposed algorithm possesses a strong local search ability.

Analysis of Benchmark
For the multimodal functions (F8-F23), ERHHO gets the best mean values except for F9 and the best stand deviations except for F14 and F20. e goal of multimodal functions is to evaluate the exploration capability. From the test of F8-F23, we can verify that the global ability of ERHHO is excellent.
In conclusion, the ERHHO algorithm outperforms the other compared algorithms in unimodal functions, which due to the random walk strategy, the algorithm's capacity to jump out of the local optimum can be effectively boosted. For the multimodal benchmark functions, the performance of proposed ERHHO is competitive as well. e reason for the excellent performance of ERHHO in the exploration phase is mainly due to the exploration factor. e exploration factor can expand the scope of exploration that is why ERHHO can find the result faster and more accurately. We tried the experiment of adding the exploration factor only to the original HHO, and the results of some multimodel test functions were better than before. Especially, for F21-F23, the result was improved remarkably and close to the theoretical values (see Table 5). Figure 6 depicts the results of analyzing the proposed algorithm's convergence in various functions (F3, F5, F7-F10, F12-F15, and F19-F23). For unimodal functions (F3, F5, and F7), the differences in convergence curves between ERHHO and HHO can be observed visually from F5, which represents higher accuracy values after several step-like descents. at is, because when the hawks get trapped, ERHHO activates the random walk strategy, which can help the hawks fly deviate from the trap and lead to a new position with more possibilities. ese three functions can reflect that ERHHO possesses a faster convergence speed and a higher accuracy than HHO and the other competitive algorithms in unimodal functions. e conclusion also holds in multimodal functions. Many of the figures show the ERRHO can get the optimal values directly after several iterations such as F8-F10, F14-F15, and F19-F23 that is because of the strong exploration ability of ERHHO whose global search scope is twice as wide as before in the early period, so the ERHHO algorithm can converge very fast. For F12, the ERHHO and HHO get a similar trend before iteration 100, but after that, ERHHO dive suddenly and get the best accuracy from all competitors. e reason is the coordination of local strategy and global search ability. e local strategy has the characteristic of a large deviation in the early stage and a small deviation in the later period. e cooperation helps the ERHHO jump out of the local optima and find better fitness values by a wide search scope. e situation is reflected in F13 as well because the functions of F12 and F13 have similar graphical features (many close local optimal points).

Convergence Analysis.
It can be seen that no matter for unimodal functions or multimodal functions, the proposed algorithm provides a better convergence pattern in almost all functions.

Wilcoxon Signed-Rank Test.
e Wilcoxon signed-rank (WSR) test is used to show that the results are statistically  Table  3: Parameters sensitivity analysis.    [48], which includes 30 test functions with unimodal, multimodal, hybrid, and composition types (see Table 7). In this experiment, we set dim � 10 for all functions. HHO algorithm performs poorly on complicated problems such as CEC2017 but focuses on tackling simple, traditional, high-dimensional issues. We compared the proposed algorithm with HHO or optimizer based on HHO is more rational. We tested ERHHO on CEC2017 test functions (excluding F2, which is unstable) and compared it with HHO, DHHO/M, HHOCM, and CEHHO [42]. Each function was put to the test 30 times with 1,000 iterations, and the dimensions of all functions were set to 10. e results of CEC2017 test functions are listed in Table 8, which utilize Friedman's mean rank, and the best values are provided in bold. According to Table 8, the proposed algorithm performed well in F1 and got the second rank in F3. We can say, the performance of ERHHO is similar to HHOCM and better than other algorithms for unimodal functions. For multimodal functions, ERHHO has a slight advantage over HHOCM and CEHHO but outperforms others. But, for hybrid and composition functions, ERHHO shows a huge lead over the other algorithms. We evaluate the algorithms group by different types of unimodal, multimodal, hybrid, and composition (see Figure 7). From Figure 7, ERHHO got the same Friedman rank value as HHOCM on the type of unimodal and multimodal but obviously outperformed other algorithms. For the type of hybrid and composition, ERHHO got the optimal ranking in all competitive algorithms.  Table 2.

Tension/Compression Spring Design Problem.
is challenge [49] aims to find the optimum variables of wire diameter (d), average coil diameter (D), and the number of active coils (N) by the optimization algorithms for obtaining the minimum weight of the tension or compress spring under four constraints. e tension/compression spring structure is shown in Figure 8. e conditions and formulations are as follows: Consider Minimize Subject to (24) Table 9 shows the results of ERHHO and compared algorithms for solving this problem, and we can see that the ERHHO algorithm obtained the best performance among all competitors.

Pressure Vessel Design Problem.
e problem's primary goal is to obtain set values of the shell (T s ), the thickness of the head (T h ), the inner radius (R), and the length of the cylindrical section (L) by the optimization  Computational Intelligence and Neuroscience algorithms for reducing the cost of cylindrical pressure vessels [51] while meeting the pressure requirements. e structure of the pressure vessel is shown in Figure 9. e mathematical formula is represented as follows: Consider Minimize Subject to Variable range  14 Computational Intelligence and Neuroscience We can see from Table 10 that ERHHO was able to find the optimal solution at the lowest cost compared to other competitor algorithms.

e ree-Bar Truss Design Problem.
e three-bar truss design problem arises from civil engineering [52,53].  is problem aims to minimize the weight in truss design with stress, deflection, and buckling constraints. ere are two parameters, A1 and A2, involved in this design problem, and we should find the best value of A1 and A2 by the optimization algorithm for achieving the goal above. e design is shown in Figure 10. e model of the problem is depicted as follows: Consider Minimize Subject to Variable range e results for the three-bar truss design problem are listed in Table 11. As we can see, the ERHHO algorithm can achieve the best performance as well as the SSA algorithm in solving this problem.  Th R Ts L 2R Figure 9: Pressure vessel design problem [50]. 18 Computational Intelligence and Neuroscience 4.6.4. Cantilever Beam Design. Cantilever beam design is one problem in which hollow square cross-section parameters (x 1 -x 5 ) are optimized [54] by optimization algorithms to obtain the cantilever beam's minimum weight. is problems' architecture is depicted in Figure 11. e mathematical equations are described as follows: Consider Minimize Subject to Variable range Table 12 summarized the findings, from which we can see that ERHHO was capable of finding the optimal solution and obtained total weight is minimized.
Subject to  (39) Table 13 shows the test results that demonstrate the proposed algorithm's effectiveness in obtaining the optimal values for solving this problem.

Conclusion
In this paper, an improved HHO algorithm named ERHHO is proposed to overcome the shortcoming of the basic HHO algorithm.
e ERHHO algorithm starts with initializing population positions, where we introduced the tent chaotic map to improve the diversity. And then three phases: exploration, transaction from exploration to exploitation, and exploitation, are performed. We proposed an exploration factor to update the formula to expand the global search range at the exploration phase. And, at the phase of exploitation, we proposed a random walk strategy after four hunting strategies to effectively improve the ability to find more accurate results. Twenty-three standard benchmark functions evaluate the proposed algorithm's ability in the stage of exploration and exploitation. e results verified that the proposed ERHHO algorithm can yield very effective outcomes and get almost the best results compared to the other algorithms.
en the Wilcoxon signed-rank test is used to demonstrate the significant differences between ERHHO and other competing algorithms. e algorithm's superiority is further demonstrated by testing on five engineering design problems and CEC2017 test functions for real problems. Furthermore, some challenges in the real world can be solved by using ERHHO properly, such as feature selection, multithreshold image segmentation, convolution neural network, and so on. For further verification, another inquiry will be performed on whether this hybrid method can improve the performance of other optimization algorithms. Data Availability e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.